package com.jy.admin.rest;


import com.jy.admin.annotations.AdminSignIgnore;
import com.jy.admin.db.dao.CeAgentAccountDao;
import com.jy.admin.db.dao.CeMerchantDao;
import com.jy.admin.enums.CurrentUserBean;
import com.jy.bo.common.conf.api.ApiResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin")
public class AdminController {
    private final static Logger LOGGER = LoggerFactory.getLogger(AdminController.class);

    @Autowired
    CeAgentAccountDao ceAgentAccountDao;

    @Autowired
    CeMerchantDao ceMerchantDao;


    @AdminSignIgnore
    @RequestMapping("/login")
    public ApiResponse<String> login(String account,String pwd) {
        if (account.equals("admin") && pwd.equals("123456")){
            return new ApiResponse<>("success");
        }
        return new ApiResponse<>(201,"登录失败");
    }

    @AdminSignIgnore
    @RequestMapping("/currentUser")
    public ApiResponse<CurrentUserBean> currentUser() {
        CurrentUserBean bean = new CurrentUserBean();
        bean.setName("admin");
        return new ApiResponse<>(bean);
    }



}
